package text;
import java.util.Scanner;
public class userLogin {
    public static void main(String[] args) {
        String userName = "xiaoTao";
        String userPass = "XiaoTao123";
        for (int i = 0; i < 3; i++) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入用户名:");
            String name = sc.nextLine();
            System.out.println("请输入密码：");
            String pass = sc.nextLine();
            if(pass.equals(userPass)&&name.equals(userName)){
                System.out.println("登陆成功");
                break;
            }else{
                System.out.println("登陆失败,你还剩"+(2-i)+"次机会");
            }
        }

    }
}


